<?php
class User_Form_ChangePass extends Zend_Form
{
   public function init()
    {
       $this->setAction ( '' )
          ->setMethod ( 'post' );    
           
      // Create and configure current password element:
      $cpassword = $this->createElement ( 'password', 'cpassword' );
      $cpassword->addValidator ( 'StringLength', false, array (6 , 20) )
             ->setRequired ( true )
             ->setLabel('Current password:')
             ->setAttrib('class', 'input-text-login');
             
      // Create and configure new password element:
      $npassword = $this->createElement ( 'password', 'npassword' );
      $npassword->addValidator ( 'StringLength', false, array (6 , 20) )
             ->setRequired ( true )
             ->setLabel('New password:')
             ->setAttrib('class', 'input-text-login');
      
      
      $submit = $this->createElement('submit', 'submit');
        $submit->setAttrib('id', 'submit_register');
        $submit->setLabel('Submit');
        $submit->setAttrib('class', 'button');
        $submit->setDecorators(array('ViewHelper', array('HtmlTag', array('tag' => 'hb'), array('Label', array('tag' => '')))));
      
      $cancel = $this->createElement('submit','back',array ('label' => 'Cancel'));
      $cancel->setDecorators(array( 'ViewHelper', array('HtmlTag', array('tag' => 'hb') ,array('Label', array('tag' => '')))));
      $cancel->setAttrib('class', 'button');   
      // Add elements to form:
      $this->addElement ( $cpassword )
           ->addElement ( $npassword )           
           ->addElement($submit)
           ->addElement($cancel);
    }
}